package com.springdemo.controllers;

import com.springdemo.entities.RequestInfo;
import com.springdemo.entities.User;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * Created by liwei.b on 2016/10/19.
 */
@RestController
@RequestMapping("/User")
public class UserController {
    @RequestMapping("/Get")
    public User getUser(@ModelAttribute("req") RequestInfo req) {
        User u=new User();
        u.setName(req.getName());
        u.setPassword(UUID.randomUUID().toString());
        return u;
    }
}
